<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>布尔运算符!会先将数据转为boolen类型，然后再取反</p>
    <p>在js中，一下6个在!后为true</p>

    <ul>
        <li>undefined</li>
        <li>null</li>
        <li>false</li>
        <li>0</li>
        <li>NaN</li>
        <li>""（空字符串）</li>
    </ul>

    <hr>

    <p>与和或的运算符在js中为&&和||</p>

    <script>
        console.log(!undefined);
        console.log(!null);
        console.log(!false);
        console.log(!0);
        console.log(!NaN);
        console.log(!"");
    </script>
</body>

</html>